/**
 * 游戏状态
 */

// 初始化状态
const state = {
  stage: 0 // 0为版权页，1为开始界面， 2为部署， 3为战斗，4为战报
}

const getters = {
  // currentStage: () => state.stage
}

const actions = {
  changeStage: ({commit}, num) => {
    commit('setStage', num)
  },

  goStartPage: ({commit}) => {
    commit('setStage', 1)
  }
}

const mutations = {
  setStage (state, stage) {
    state.stage = stage
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}
